package com.csxy.six.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(name = "Goods对象", description = "商品信息")
public class Goods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "goods_id", type = IdType.AUTO)
    private Integer goodsId;

    @Schema(description = "商品标题")
    private String title;

    @Schema(description = "商品描述")
    private String description;

    @Schema(description = "价格")
    private BigDecimal price;

    @Schema(description = "卖家ID")
    private Integer sellerId;

    @Schema(description = "商品状态（在售,交易中,已售,已下架）")
    private String status;

    @Schema(description = "商品分类ID")
    private Integer goodsCatId;

    @Schema(description = "联系方式")
    private String contactInfo;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime createdAt;

    @Schema(description = "浏览次数")
    private Integer viewCount;
}
